<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //方法2：利用 new Object创建对象
        var obj = new Object();
        obj.name = '小杨';
        obj.age = 18;
        obj.sex = '男';
        obj.sayHello = function(){
            console.log('Hello');
        }
    </script>
</head>
<body>
    
</body>
</html>